/*****************************************************************************\

Microsoft Research Asia
Copyright (c) Microsoft Corporation. All Rights Reserved.

Module Name:
DetConfig.h

Notes:
This module is designed for defining all possible macro.

History:
Modified on Jun/25/2004 by i-tabao@microsoft.com
code clean

\*****************************************************************************/
#pragma once
#ifndef __DETCONFIG_H__
#define __DETCONFIG_H__

#include <windows.h>
//=============================================================================
//    config for objectdetector.h
//=============================================================================

#define USE_GABOR_FILTER
//#define GABOR_FORRECALL
//#define MAXIUM_SKIP
//#define AREAMERGE


#define INPLANEVARIATION 22 // Handle face with +/- 20 degree inplane rotation

//=============================================================================
// config for boosting
//=============================================================================

//define USING_REALBOOST to enable realboost algorithm
#define USING_REALBOOST
//define USING_ADABOOST to enable adaboost algorithm
//#define USING_ADABOOST

#if defined(USING_REALBOOST)
#define USED_BIN	8
#elif defined(USING_ADABOOST)
#define USED_BIN	8
#else
#error USED_BIN definition required
#endif

//=============================================================================
//Performance section
//=============================================================================
//SCALE Variance definitions, the smaller the faster the detector will be
#define FACESCALEVARIANCE 5.0 // Use for skip small faces when large face detected
#define TILT_FACESCALEVARIANCE 3 // Use for skip small tilt faces when large face detected

//Start scale definitions for extended detection, the larger the faster the detector will be
#define EXTMOD_STARTSCALE 6    // The start scale for ext, tilted faces
#define PROFILEMOD_STARTSCALE 6    // The start scale for profiled faces


//=============================================================================
//    config for boosting.h
//=============================================================================
#define MODEL_SIZE_MAX 25			// MODEL_SIZE_MAX >= MAX(GetModelWidth(), GetModelHeight())+1
#define USING_DISCRETE_MODEL

#ifdef USING_DISCRETE_MODEL
#define CLASSIFYTYPE int 
#define ALPHA_SCALE  (1<<20)
#define THRESHOLD_SCALE (1<<15)
#else
#define CLASSIFYTYPE float 
#define ALPHA_SCALE  1.0f
#endif

//=============================================================================
//    config for integral image
//=============================================================================
#define USE_PROFILE_COLOR
#define AUTOCONTRAST_FACTOR  1.0f                  //In the gray-scale histogram,
//find the shortest range with 98% energy,
// then extend the range to 256 level
//#define USE_VARIANCE

//=============================================================================
//    config for facedetectorsrc.h
//=============================================================================

#define ENABLE_FILE_INPUT_SUPPORT

//=============================================================================
//    config for different detection level
//=============================================================================
enum 
{    
	E_FRONTAL = 0x01, 
	E_INPLANE22 = 0x02, 
	E_INPLANE45 = 0x04, 
	E_INPLANE67 = 0x08, 
	E_INPLANE90 = 0x10, 
	E_INPLANE112 = 0x20, 
	E_INPLANE135 = 0x40, 
	E_INPLANE157 = 0x80, 
	E_INPLANE180 = 0x100,
	E_FRONTALEXT = 0x200, 
	E_PROFILE = 0x400, 
};

enum 
{ 
	E_INPLANE_LEVEL0 = E_FRONTAL, 
	E_INPLANE_LEVEL1 = E_INPLANE_LEVEL0 | E_INPLANE22,
	E_INPLANE_LEVEL2 = E_INPLANE_LEVEL1 | E_INPLANE45,
	E_INPLANE_LEVEL3 = E_INPLANE_LEVEL2 | E_INPLANE67,
	E_INPLANE_LEVEL4 = E_INPLANE_LEVEL3 | E_INPLANE90,
	E_INPLANE_LEVEL5 = E_INPLANE_LEVEL4 | E_INPLANE112,
	E_INPLANE_LEVEL6 = E_INPLANE_LEVEL5 | E_INPLANE135,
	E_INPLANE_LEVEL7 = E_INPLANE_LEVEL6 | E_INPLANE157,
	E_INPLANE_LEVEL8 = E_INPLANE_LEVEL7 | E_INPLANE180
};

//=============================================================================
//    config for constants
//=============================================================================
#define MAXIMAGEWIDTH 32768
#define MAXIMAGEHEIGHT 32768
#define MAXBUFFERSIZE 1024 * 1024 * 1024

#ifndef USING_LONGHORN

#ifndef HDSA
#define HDSA unsigned long
#endif

//=============================================================================
//        defination of buffer anotation in Longhorn
//=============================================================================

#endif			//USING_LONGHORN

#endif			//__DETCONFIG_H__